package org.example;

public class homework4 {
    public static void main(String[] args) throws InterruptedException {
        Thread c = new Thread(()->{
            System.out.println(Thread.currentThread().getName());
        },"c");
        Thread b = new Thread(()->{
            try {
                c.join();
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
            System.out.println(Thread.currentThread().getName());
        },"b");
        Thread a = new Thread(()->{
            try {
                b.join();
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
            System.out.println(Thread.currentThread().getName());
        },"a");
        a.start();
        b.start();
        c.start();
    }
}
